<?

/**	
 *	Text.form OBJECT
 *	
 *	frontend module for ajax-based forms
 *	3 main forms (simple - labeled - sequenced)
 *	make sure you check out the examples at the bottom of this file tot help you out
 *	
 * 	the class is documented in the file itself. if you find any bugs help us out and report them. 
 * 	if you report a bug, make sure you give us enough information (include your code).
 *
 *	@copyright		oneDot only <we@onedotonly.be>
 * 	@copyright		Copyright (c) 2010, oneDot only. All rights reserved.
 * 	@license		BSD License
 *
 *	@author			oneDot only <we@onedotonly.be>
 */


class TextForm extends modTEXT {


	/**
	 * 	define output
	 *
	 *	this is the base for rendering the form at the frontend
	 *	while rendering the form css is added, an IE check is executed, javascript is added
	 *
	 *	@return		string - the form
	 *	@param		string (action)
	 *	@param		boolean (vars->iewarn)
	 */
	 
	public function output() {
	
		if( $this->action )
			$nodes = $this->{ "filter_" . $this->action }();
		
		$result = ( $nodes ) ? $this->form->render( $nodes ) : "empty.";
		
 		// check for ie and warn people about this monster
		if ($this->vars->iewarn && IE) {
			$result 	.= '<span class="iewarn">You might have to lower your security settings to send.</span>';
		}
		
 		// push_content puts content after text, parse before
		$this->push_content = $result;
		return $this->parse( ) . $this->render_js();
		
	}
	
	
	/**
	 *	make ajax call to function (defined by js)
	 *
	 *	@return		undefined 
	 *	@param		string (action)
	 */	 
	
	public function ajax() {
	
		if( $this->action )
			$result = $this->{ "ajax_" . $this->action }();
			
		return $result;
	
	}
	
	
#	HTML Module.
#	Output actions	

	/**
	 *	render simple form
	 *
	 *	define simple form elements with no labels, just values 
	 *	used for login / subscription to newsletters..
	 *
	 *	@return		array
	 *	@param		array (vars)
	 */
	 
	private function filter_simple() {
	
		if( in_array( 'login', array_values( (array) $this->vars->actions )) && $_SESSION[ 'uid' ] ) 
			return array( "h2" => translate( 'u bent reeds ingelogd' ));
		else {
			$this->js = "mod = new TextForm( 'simple', " . json_encode( $this->vars ) . ", {$this->modid} )";
			return $this->form->filter( $this->vars->children );
		}
	}
	


	/**
	 *	render labeled form
	 *
	 *	define form elements with labels, values, classes
	 *	used for most of the forms 
	 *
	 *	@return		array
	 *	@param		array (vars)
	 */
	 
	private function filter_labeled() {
		global $Object;
		
		$this->addclass( "label" );
		
		// add hidden field for objid
		if( $this->vars->db->refer->parenttype && $Object->id ) {
			if( $children = (array) $this->vars->children ) {
				$this->vars->children = (object) array_merge( array( "objid" => (object) array( "type" => "hidden", "defined" => $Object->id, "value" => "objid", "class" => "wide req hide" )), array( "objtype" => (object) array( "type" => "hidden", "defined" => $Object->get( 'type' ), "value" => "objtype", "class" => "wide req hide" )), (array) $children );
			}
				
			if( $children = (array) $this->vars->groups ) {
				$first = key( $children );
				$this->vars->groups->$first = (object) array_merge( array( "objid" => (object) array( "type" => "hidden", "defined" => $Object->id, "value" => "objid", "class" => "wide req hide" )), array( "objtype" => (object) array( "type" => "hidden", "defined" => $Object->get( 'type' ), "value" => "objtype", "class" => "wide req hide" )), 
					(array) $this->vars->groups->$first );
			}
			
		}
		
		if( $this->vars->groups )
			foreach( $this->vars->groups as $class => $group ) {
				
				$nodes[]	= "<span class='group $class'>";
				if( count( $group ))
					$nodes	= array_merge( $nodes, $this->form->filter_labeled( $group ));
				
				$nodes[]	= "<div class='stablize'></div></span>";
			}
		else
			$nodes	= $this->form->filter_labeled( $this->vars->children );
				
		
		$this->js = "mod = new TextForm( 'label', ". json_encode( $this->vars->validate ) .", {$this->modid} )";

		return $nodes;
	}
	
	
	
	/**
	 *	render sequenced form
	 *
	 *	define form elements with labels, values, classes
	 *	creates a sequence of multiple forms, connected by id's
	 *	used placing orders..
	 *
	 *	@return		array
	 *	@param		array (vars)
	 */
	 
	private function filter_sequence() {
	
		// add custom class
		$this->class = 'sequence';
	
		if( $forms = $this->vars->forms ) {
			
			$i = 0;
			foreach ( $forms as $xclass => $form ) {
				$nodes[]	= "<span class='form " . $xclass . (( $i != 0 )? " hide": "") . "'>";
				if( $form->groups ) {
					foreach( $form->groups as $class => $group ) {
						
						$nodes[]	= "<span class='group " . $class . "'>";
						if( count( $group ))
							$nodes	= array_merge( $nodes, $this->form->filter_labeled( $group ));
						
						$nodes[]	= "<div class='stablize'></div></span>";
					}
				} else {
					$nodes	= $this->form->filter_labeled( $this->vars->children );
				}
				$nodes[]	= "</span>";
				$i++;
			}
		}
		
		$this->js = "mod = new TextForm( 'sequence', ". json_encode( $this->vars->validate ) .", {$this->modid} )";
		return $nodes;
	}	
	


#	JAVASCRIPT Request.
#	Ajax actions	

  	/** 
  	 * login with update & redirect
  	 */
  	 	
	private function ajax_login() {
		global $Engine;
		
		if( $Engine->user_authenticate( $_POST['user'], $_POST['pass'], 4 ) ) {
		
				$update =  array( "update"=>"Password correct.", "func"=>"redirect" );
				//print_r( $_SESSION );
		
		} else	$update = array( "update"=>"Incorrect password, please try again." );
		
		return json_encode( $update );
	}
	
	
	
  	/** 
  	 * logout with update & redirect
  	 */
  	 	
	private function ajax_logout() {
	
		unset( $_SESSION['uid'] );
	
		$update = array( "update" => "Logout successful", "func"=>"redirect" );
		return json_encode( $update );
	
	}
	
	
	
  	/** 
  	 * forgot pass with update & email
  	 */
  	 	
	private function ajax_forgot_pass() {
		global $DB;
		
		// check for user
		$user = $DB->get( 'user', 'user = "' . mysql_real_escape_string( $_POST[ 'user' ] ) . '"' );

		if( $user ) {
			
			// add content
			$content = '"' . $user['pass'] . '"';
			
			// send mail		
			$Letter	= new MAIL( "html" );
			$Letter->generate( $this->modid, $content );	
			$Letter->send_single(( int ) $user[ 'ID' ] );
			
			// frontend confirmation
			$update = array( "update" => "You've got mail");

		} else {
			
			$update = array( "update" => "No user found");
		
		}
		
		return json_encode( $update );
	
	}
	
#	Action push (simple)	
	private function ajax_simple() {
		global $DB, $Engine;
		
		$update = (( $upkey = $this->vars->db->update ) && $_POST[ key( $upkey )])?
			array( current( $upkey ) => $_POST[ key( $upkey )]) : false;
		
		$defined = $this->form->keys();
		// temp
		if( $this->vars->db->columns->llog ) $this->vars->db->columns->llog = date( "Y-m-d H:m:s" );

		if( $this->vars->db->columns )
			foreach( $this->vars->db->columns as $column => $value )
				if( !in_array( $column, $defined )) $input[ $column ] = $value;
		
		foreach( $defined as $key )
			if( $this->vars->db->columns->{ $key }) $input[ $this->vars->db->columns->{ $key }] = $_POST[ $key ];
			else if( $_POST[ $key ]) $input['meta'][ $key ] = $DB->pregstring( $_POST[ $key ], "/[\'\"\`]/" );
		
		if( !$input[ 'lang' ] )
			$input[ 'lang' ] = engine_get( 'lang.master' );
		
		if( @$DB->set ( $this->vars->type, $input, $update )) {			
			$answer 	= translate( "Inschrijving gelukt!" ); // U krijgt de volgende nieuwsbrief spoedig toegestuurd.
		} else {
			$answer		= translate( "U was reeds ingeschreven" );
		}
		return json_encode( array( "update"=> $answer ));
	}

#	Action labeled
	private function ajax_labeled() {
		global $DB, $Engine, $Object;
						
		$update = (( $upkey = $this->vars->db->update ) && $_POST[ key( $upkey )])?
			array( current( $upkey ) => $_POST[ key( $upkey )]) : false;
		
		$defined = $this->form->keys();
		
		// check for latlng (add pinpoint)
		if( $_POST[ 'll' ]) $defined[] = 'll';
		
		// temp
		if( $this->vars->db->columns->llog ) $this->vars->db->columns->llog = date( "Y-m-d H:m:s" );

		if( $this->vars->db->columns )
			foreach( $this->vars->db->columns as $column => $value )
				if( !in_array( $column, $defined )) $input[ $column ] = $value;
		
		foreach( $defined as $key )
			if( $this->vars->db->columns->{ $key }) $input[ $this->vars->db->columns->{ $key }] = $_POST[ $key ];
			else if( $_POST[ $key ]) $input['meta'][ $key ] = $DB->pregstring( $_POST[ $key ], "/[\'\"\`]/" );
		
		// check to insert object (with textid)
		if( $this->vars->db->obj ) {
			$input[ 'nameid' ] = $Engine->text->set( mysql_real_escape_string( (string) $_POST[ $this->vars->db->obj->nameid ]), null, 'short', LANG );
			$input[ 'textid' ] = $Engine->text->set( mysql_real_escape_string( (string) $_POST[ $this->vars->db->obj->textid ]), null, 'long', LANG );
			unset($input[ 'meta' ][ $this->vars->db->obj->nameid ]);
			unset($input[ 'meta' ][ $this->vars->db->obj->textid ]);
		}
		
		if( !empty( $_SESSION[ 'uid' ] ) && $DB->column_exists( $this->vars->type, 'creator', true ))
			$input[ 'creator' ] = $_SESSION[ 'uid' ];
			
		$objid = $DB->set( $this->vars->type, $input, $update );
		
		// check to insert reference
		if( $this->vars->db->refer ) 
			$DB->set_reference( $this->vars->db->refer->parenttype, (int) (( $Object->id ) ? $Object->id : mysql_real_escape_string( $_POST['objid'] )), $this->vars->type , (int) $objid, $this->vars->db->refer->tablestring );
		

		if( $this->vars->sendin ) $this->mailto( $this->vars->sendin );
		if( $this->vars->sendconf ) $this->mailconf( $this->vars->sendconf );
		
		return json_encode( "succes" );

	}
	
#	Send mail with data ( sendin/sendconf )
	function mailto( $vars ) {
		global $DB, $Engine;
		
		$content = "<table><tbody>";
		foreach( $_POST as $key=> $value ) {
			if ( !empty( $_POST[$key] ))
				$content .= "<tr><td>$key</td><td>".  $DB->pregstring( $value, "/[\'\"\`]/" ) ."</td></tr>";
		}
		
		if( $_POST[ 'objid' ] && $_POST[ 'objtype' ] ) {
			$ActiveObject	= new OBJECT( $DB->type_r( mysql_real_escape_string( $_POST[ 'objtype' ] )), (int) $DB->smartq( $_POST[ 'objid' ] ));
			$content .= "<tr><td>url</td><td><a href='" . $ActiveObject->url() ."'>" . $ActiveObject->url() . "</td></tr>"; 
		}
		
		$content.= "</tbody></table>";
		
		$Letter	= new MAIL( "html" );
		$Letter->generate( $vars->mod, $content );
		$Letter->send_single(( int ) $vars->user );

	}

#	Send mail with data (sendin/sendconf)
	function mailconf( $vars ) {
		global $DB, $Engine;
		
		// define link (based on conf_var
		$link = engine_get( 'url' ) . (( $vars->conf_link ) ? '/' . $vars->conf_link : '' );
		if ( $vars->conf_var ) {
			$link .= '?';
			foreach ( $vars->conf_var as $var ) {
				$link .= $var . '=' . mysql_real_escape_string( $_POST[$var] ) . '&';
			}
			$link = substr( $link, 0, -1 );
		}

		$user = $DB->get_key( 'user', 'user = "' . mysql_real_escape_string( $_POST['mail'] ) . '" ORDER BY ID desc', 'ID' );
		
		// define user
		if ( $vars->conf_var ) {
			$link .= '&id=' . $user;
		}
		
		// define content
		$content = '<a href="' . $link . '" title="">' . (( $text = $vars->conf_text )? $text : $link ) . '</a>';
				
		$Letter	= new MAIL( "html" );
		$Letter->generate( $vars->mod, $content );
		$Letter->send_single(( int ) $user );

	}

} 


/*
Wedstrijd:

{	"mod":"text.form", "action":"labeled", "class":"grey","vars":{
		
		"groups"	: {
			
			"grey two"	: {
				"tle1"		: { "type":"h2", "value":"Vraag 1" },
				"req1"		: { "type":"span", "class":"wide","value":"Madness had vele hits, welke hit begint met het geluid van een scheepshoorn?" },
				"answer1"	: { "type":"select", "class":"wide" }
			},
			"grey three"	: {
				"tle2"		: { "type":"h2", "value":"Vraag 2" },
				"req2"		: { "type":"span", "class":"wide","value":"Welk verzamelalbum bracht Madness niet uit?" },
				"answer2"	: { "type":"select", "class":"wide" }
			},
			"grey four"	: {
				"tle3"		: { "type":"h2", "value":"Vraag 3" },
				"req3"		: { "type":"span", "class":"wide","value":"Wanneer werd Madness opgericht?" },
				"answer3"	: { "type":"select", "class":"wide" }
			},
			
			"grey zero"	: {
				"shift"	: { "type":"text", "class":"left wide req", "value":"Hoeveel deelnemers gaven een correct antwoord op de drie vragen voor dinsdag 15 juni om middernacht?" }
			},
			
			"grey one"	: {
				"fname"		: { "type":"text", "class":"left req", "value":"voornaam" },
				"lname"		: { "type":"text", "class":"right req", "value":"naam" },
				"mail"		: { "type":"text", "class":"left req", "value":"e-mail adres" },
				"mailconf"	: { "type":"text", "class":"right req", "value":"herhaal e-mail" },
				"adress"	: { "type":"text", "class":"wide", "value":"adres" },
				"city"		: { "type":"text", "class":"extend left", "value":"gemeente" },
				"pcode"		: { "type":"text", "class":"small right", "value":"postcode" }
			},
			
			"white five": {
				"letter"	: { "type":"checkbox", "class":"left", "value":"Ik wil graag de nieuwsbrief ontvangen van het Gent Jazz Festival" },
				"conf"		: { "type":"submit", "class":"dark right", "value":"verzend" }
			}
			
		},
		
		"select"	: {
			"answer1"	: [[1,"Nightboat to London"], [2,"Nightboat to Dakar"], [3,"Nightboat to Ca&iuml;ro"]],
			"answer2"	: [[1,"Utter Madness"], [2,"Divine Madness"], [3,"Beyond Madness"]],
			"answer3"	: [[1,"1976"], [2,"1977"], [3,"1978"]]
		},
		
		"validate"	: {
			"mail"		: { "event": "blur", "action":"reg", "cond":"[\\w-.\\+]@[\\w-.]", "err":"foutief e-mail adres" },
			"mailconf"	: { "event": "blur", "action":"clone", "cond":"mail", "err":"e-mail niet identiek" },
			"conf"		: { "event": "click", "action":"req", "err":"niet alle velden zijn (correct) ingevuld", "succ":"bedankt voor je deelname! We nemen spoedig contact met je op.  Heb je specifieke vragen of opmerkingen, mail gerust naar info@gentjazz.com ." }
		},
		"db"		: {
			"update"	: { "mail":"user" },
			"columns"	: { "mail":"user", "rank":3, "llog":"now()" }
		},
		"type"		: "user",
		"sendin"	: { "mod":67, "user":3 }

	}, "nameid":0,"textid":0 }





Press login:

{ 	"mod":"text.form", "action":"simple", "class":"dark", "vars":{
		"children"	: {
			"pass"		: { "type":"text", "class":"small", "value":"password" },
			"user"		: { "type":"hidden", "value":"press.default" },
			"conf"		: { "type":"button", "class":"dark", "value":"log in" }
		},
		"validate"		: {},
		"actions"		: { "conf":"login" },
		"redirect"		: "pro/press",
		"sendin"		: "koen@onedotonly.be"
	}, "nameid":1150,"textid":1736, "tleref":{"h":"h3"} }


Newsletter:

{ 	"mod":"text.form", "action":"simple", "class":"grey","vars":{
		"children"	: {
			"fname"	: { "type":"text", "class":"small", "value":"voornaam" },
			"lname"	: { "type":"text", "class":"small", "value":"naam" },
			"email"	: { "type":"text", "class":"small", "value":"e-mail adres", "style":"margin-top: 5px;" },
			"conf"	: { "type":"button", "class":"dark", "value":"schrijf me in!" }
		},
		"actions"		: { "conf":"submit" },
		"db"		: {
			"update"	: { "email":"user" },
			"columns"	: { "email":"user", "rank":1, "llog":"now()" }
		},
		"type"		: "user"
	}, "nameid":1719,"textid":1720, "tleref":{"h":"h3"} }
	

{	"mod":"text.form","action":"labeled","class":"grey","vars":{
		"children"	: {
			"title"		: { "type":"text", "class":"wide req", "value":"titel" },
			"descr"		: { "type":"text", "class":"wide req", "value":"beschrijving" },
			"submit"	: { "type":"button", "class":"dark", "value":"verzenden" }
		},
		"validate"	: {
			"submit"	: { "event": "click", "action":"req", "err":"niet alle velden zijn (correct) ingevuld", "succ":"bedankt voor je enthousiasme!" }
		
		}
	}
}


Gentjazz vrijwilligers:

{	"mod":"text.form", "action":"labeled", "class":"grey","vars":{
		
		"groups"	: {
			"grey one"	: {
				"fname"		: { "type":"text", "class":"left req", "value":"voornaam" },
				"lname"		: { "type":"text", "class":"right req", "value":"naam" },
				"mail"		: { "type":"text", "class":"left req", "value":"e-mail adres" },
				"mailconf"	: { "type":"text", "class":"right req", "value":"herhaal e-mail" },
				"web"		: { "type":"text", "class":"left", "value":"web/social" },
				"nosocial"	: { "type":"checkbox", "class":"right", "value":"verberg voor anderen" }
			},
			"grey two"	: {
				"gsm"		: { "type":"text", "class":"left req", "value":"gsm-nummer" },
				"tel"		: { "type":"text", "class":"right", "value":"vast of werknummer" },
				"adress"	: { "type":"text", "class":"wide", "value":"adres" },
				"city"		: { "type":"text", "class":"extend left", "value":"gemeente" },
				"pcode"		: { "type":"text", "class":"small right", "value":"postcode" }
			},
			"grey three": {
				"birthd"	: { "type":"select", "class":"small left req", "value":"geb.datum" },
				"birthm"	: { "type":"select", "class":"small left" },
				"birthy"	: { "type":"select", "class":"small left" },
				"sex"		: { "type":"select", "class":"small right req", "value":"geslacht" },
				"occup"		: { "type":"text", "class":"extend left", "value":"beroep of studie" },
				"loontrk"	: { "type":"select", "class":"small right", "value":"loontrekkend" }
			},
			"grey four"	: {
				"license"	: { "type":"select", "class":"small left", "value":"rijbewijs" },
				"licdate"	: { "type":"select", "class":"small left", "value":"datum" },
				"clark"		: { "type":"select", "class":"right", "value":"clarkbrevet" },
				"taken"		: { "type":"text", "class":"wide", "value":"gewenste taak/taken" },
				"gjstart"	: { "type":"select", "class":"left", "value":"Beschikbaar voor" },
				"gjend"		: { "type":"select", "class":"right", "value":"Gent Jazz Festival" },
				"jmstart"	: { "type":"select", "class":"left", "value":"Beschikbaar voor" },
				"jmend"		: { "type":"select", "class":"right", "value":"Jazz Middelheim" }
			},
			"white five": {
				"letter"	: { "type":"checkbox", "class":"left", "value":"stuur me de nieuwsbrief", "checked":"checked" },
				"conf"		: { "type":"submit", "class":"dark right", "value":"verzend" }
			}
			
		},
		
		"select"	: {
			"birthy"	: [[1995],[1994],[1993],[1992],[1991],[1990],[1989],[1988],[1987],[1986],[1985],[1984],[1983],[1982],[1981],[1980],[1979],[1978],[1977],[1976],[1975],[1974],[1973],[1972],[1971],[1970],[1969],[1968],[1967],[1966],[1965],[1964],[1963],[1962],[1961],[1960],[1959],[1958],[1957],[1956],[1955],[1954],[1953],[1952],[1951],[1950],[1949],[1948],[1947],[1946],[1945],[1944],[1943],[1942],[1941],[1940]],
			"birthm"	: [["01","januari"],["02","februari"],["03","maart"],["04","april"],["05","mei"],["06","juni"],["07","juli"],["08","augustus"],["09","september"],["10","oktober"],["11","november"],["12","december"]],
			"birthd"	: [["01"],["02"],["03"],["04"],["05"],["06"],["07"],["08"],["09"],[10],[11],[12],[13],[14],[15],[16],[17],[18],[19],[20],[21],[22],[23],[24],[25],[26],[27],[28],[29],[30],[31]],
			"sex"		: [["m","man"],["f","vrouw"]],
			"loontrk"	: [[0,"neen"],[1,"ja"]],
			"license"	: [[0,"neen"],[1,"ja, sinds:"]],
			"licdate"	: [[0,"----"],[2010],[2009],[2008],[2007],[2006],[2005],[2004],[2003],[2002],[2001],[2000],[1999],[1998],[1997],[1996],[1995],[1994],[1993],[1992],[1991],[1990],[1989],[1988],[1987],[1986],[1985],[1984],[1983],[1982],[1981],[1980],[1979],[1978],[1977],[1976],[1975],[1974],[1973],[1972],[1971],[1970],[1969],[1968],[1967],[1966],[1965],[1964],[1963],[1962],[1961],[1960],[1959],[1958],[1957],[1956],[1955],[1954],[1953],[1952],[1951],[1950],[1949],[1948]],
			"clark"		: [[0,"neen"],[1,"ja"]],
			"gjstart"	: [[0,"-- vanaf --"],["28 juni"],["29 juni"],["30 juni"],["1 juli"],["2 juli"],["3 juli"],["4 juli"],["5 juli"],["6 juli"],["7 juli"],["8 juli"],["9 juli"],["10 juli"],["11 juli"],["12 juli"],["13 juli"],["14 juli"],["15 juli"],["16 juli"],["17 juli"],["18 juli"],["19 juli"],["20 juli"]],
			"gjend"		: [[0,"-- tot en met --"],["8 juli"],["9 juli"],["10 juli"],["11 juli"],["12 juli"],["13 juli"],["14 juli"],["15 juli"],["16 juli"],["17 juli"],["18 juli"],["19 juli"],["20 juli"],["21 juli"],["22 juli"],["23 juli"],["24 juli"],["25 juli"],["26 juli"],["27 juli"],["28 juli"]],
			"jmstart"	: [[0,"-- vanaf --"],["6 augustus"],["7 augustus"],["8 augustus"],["9 augustus"],["10 augustus"],["11 augustus"],["12 augustus"],["13 augustus"],["14 augustus"],["15 augustus"],["16 augustus"],["17 augustus"],["18 augustus"]],
			"jmend"		: [[0,"-- tot en met --"],["8 augustus"],["9 augustus"],["10 augustus"],["11 augustus"],["12 augustus"],["13 augustus"],["14 augustus"],["15 augustus"],["16 augustus"],["17 augustus"],["18 augustus"],["19 augustus"],["20 augustus"]]
		},
		
		"validate"	: {
			"mail"		: { "event": "blur", "action":"reg", "cond":"[\\w-.\\+]@[\\w-.]", "err":"foutief e-mail adres" },
			"mailconf"	: { "event": "blur", "action":"clone", "cond":"mail", "err":"e-mail niet identiek" },
			"conf"		: { "event": "click", "action":"req", "err":"niet alle velden zijn (correct) ingevuld", "succ":"bedankt voor je enthousiasme! We nemen spoedig contact met je op.  Heb je specifieke vragen of opmerkingen, mail gerust naar medewerkers@gentjazz.com ." }
		},
		"db"		: {
			"update"	: { "mail":"user" },
			"columns"	: { "mail":"user", "rank":3, "llog":"now()" }
		},
		"type"		: "user",
		"sendin"	: { "mod":96, "user":2 }

	}, "nameid":142,"textid":1583 }
	
{"mod":"text_form","action":"labeled","class":"grey","vars":
	{"children":{""}}}

*/





?>